package com.rs.qm.modules.sys.controller;

import java.util.Arrays;
import java.util.Map;

import com.rs.qm.modules.sys.entity.SysBusinessCategoryEntity;
import com.rs.qm.modules.sys.service.SysBusinessCategoryService;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import com.rs.qm.common.utils.PageUtils;
import com.rs.qm.common.utils.R;



/**
 * 行业分类表
 *
 * @author GuoXunMin
 * @email v450625169@126.com
 * @date 2019-12-27 16:38:06
 */
@RestController
@RequestMapping("pc/sysbusinesscategory")
public class SysBusinessCategoryController {
    @Autowired
    private SysBusinessCategoryService sysBusinessCategoryService;

    @GetMapping("/all")
    public R allCategorys(){
        return R.okData(sysBusinessCategoryService.queryAllCategory());
    }
    /**
     * 列表
     *//*
    @RequestMapping("/list")
    public R list(@RequestParam Map<String, Object> params){
        PageUtils page = sysBusinessCategoryService.queryPage(params);

        return R.ok().put("page", page);
    }


    *//**
     * 信息
     *//*
    @RequestMapping("/info/{categoryId}")
    public R info(@PathVariable("categoryId") Long categoryId){
		SysBusinessCategoryEntity sysBusinessCategory = sysBusinessCategoryService.selectById(categoryId);

        return R.ok().put("sysBusinessCategory", sysBusinessCategory);
    }

    *//**
     * 保存
     *//*
    @RequestMapping("/save")
    public R save(@RequestBody SysBusinessCategoryEntity sysBusinessCategory){
		sysBusinessCategoryService.insert(sysBusinessCategory);
        return R.ok();
    }

    *//**
     * 修改
     *//*
    @RequestMapping("/update")
    @RequiresPermissions("generator:sysbusinesscategory:update")
    public R update(@RequestBody SysBusinessCategoryEntity sysBusinessCategory){
		sysBusinessCategoryService.updateById(sysBusinessCategory);

        return R.ok();
    }

    *//**
     * 删除
     *//*
    @RequestMapping("/delete")
    @RequiresPermissions("generator:sysbusinesscategory:delete")
    public R delete(@RequestBody Long[] categoryIds){
		sysBusinessCategoryService.deleteBatchIds(Arrays.asList(categoryIds));

        return R.ok();
    }*/

}
